<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveSupport::Testing::Metrics::Base</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveSupport::Testing::Metrics::Base</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../files/vendor/rails/activesupport/lib/active_support/testing/performance_rb.html">
                vendor/rails/activesupport/lib/active_support/testing/performance.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000435">benchmark</a>&nbsp;&nbsp;
      <a href="#M000434">measure</a>&nbsp;&nbsp;
      <a href="#M000433">measure_mode</a>&nbsp;&nbsp;
      <a href="#M000432">name</a>&nbsp;&nbsp;
      <a href="#M000431">new</a>&nbsp;&nbsp;
      <a href="#M000436">profile</a>&nbsp;&nbsp;
      <a href="#M000438">with_gc_stats</a>&nbsp;&nbsp;
      <a href="#M000437">with_gc_stats</a>&nbsp;&nbsp;
      <a href="#M000439">with_gc_stats</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">total</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000431" class="method-detail">
        <a name="M000431"></a>

        <div class="method-heading">
          <a href="#M000431" class="method-signature">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000431-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000431-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 230</span>
230:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
231:             <span class="ruby-ivar">@total</span> = <span class="ruby-value">0</span>
232:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000435" class="method-detail">
        <a name="M000435"></a>

        <div class="method-heading">
          <a href="#M000435" class="method-signature">
          <span class="method-name">benchmark</span><span class="method-args">() {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000435-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000435-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 246</span>
246:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">benchmark</span>
247:             <span class="ruby-identifier">with_gc_stats</span> <span class="ruby-keyword kw">do</span>
248:               <span class="ruby-identifier">before</span> = <span class="ruby-identifier">measure</span>
249:               <span class="ruby-keyword kw">yield</span>
250:               <span class="ruby-ivar">@total</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">measure</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">before</span>)
251:             <span class="ruby-keyword kw">end</span>
252:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000434" class="method-detail">
        <a name="M000434"></a>

        <div class="method-heading">
          <a href="#M000434" class="method-signature">
          <span class="method-name">measure</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000434-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000434-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 242</span>
242:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">measure</span>
243:             <span class="ruby-value">0</span>
244:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000433" class="method-detail">
        <a name="M000433"></a>

        <div class="method-heading">
          <a href="#M000433" class="method-signature">
          <span class="method-name">measure_mode</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000433-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000433-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 238</span>
238:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">measure_mode</span>
239:             <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">Mode</span>
240:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000432" class="method-detail">
        <a name="M000432"></a>

        <div class="method-heading">
          <a href="#M000432" class="method-signature">
          <span class="method-name">name</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000432-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000432-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 234</span>
234:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">name</span>
235:             <span class="ruby-ivar">@name</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">demodulize</span>.<span class="ruby-identifier">underscore</span>
236:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000436" class="method-detail">
        <a name="M000436"></a>

        <div class="method-heading">
          <a href="#M000436" class="method-signature">
          <span class="method-name">profile</span><span class="method-args">() {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000436-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000436-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 254</span>
254:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">profile</span>
255:             <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">resume</span>
256:             <span class="ruby-keyword kw">yield</span>
257:           <span class="ruby-keyword kw">ensure</span>
258:             <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">pause</span>
259:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000438" class="method-detail">
        <a name="M000438"></a>

        <div class="method-heading">
          <a href="#M000438" class="method-signature">
          <span class="method-name">with_gc_stats</span><span class="method-args">() {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000438-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000438-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 270</span>
270:               <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_gc_stats</span>
271:                 <span class="ruby-constant">GC</span>.<span class="ruby-identifier">start</span>
272:                 <span class="ruby-constant">GC</span>.<span class="ruby-identifier">disable</span>
273:                 <span class="ruby-constant">GC</span><span class="ruby-operator">::</span><span class="ruby-constant">Profiler</span>.<span class="ruby-identifier">enable</span>
274:                 <span class="ruby-keyword kw">yield</span>
275:               <span class="ruby-keyword kw">ensure</span>
276:                 <span class="ruby-constant">GC</span><span class="ruby-operator">::</span><span class="ruby-constant">Profiler</span>.<span class="ruby-identifier">disable</span>
277:                 <span class="ruby-constant">GC</span>.<span class="ruby-identifier">enable</span>
278:               <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000437" class="method-detail">
        <a name="M000437"></a>

        <div class="method-heading">
          <a href="#M000437" class="method-signature">
          <span class="method-name">with_gc_stats</span><span class="method-args">() {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000437-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000437-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 263</span>
263:               <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_gc_stats</span>
264:                 <span class="ruby-constant">GC</span>.<span class="ruby-identifier">enable_stats</span>
265:                 <span class="ruby-keyword kw">yield</span>
266:               <span class="ruby-keyword kw">ensure</span>
267:                 <span class="ruby-constant">GC</span>.<span class="ruby-identifier">disable_stats</span>
268:               <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000439" class="method-detail">
        <a name="M000439"></a>

        <div class="method-heading">
          <a href="#M000439" class="method-signature">
          <span class="method-name">with_gc_stats</span><span class="method-args">() {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000439-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000439-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 280</span>
280:               <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_gc_stats</span>
281:                 <span class="ruby-keyword kw">yield</span>
282:               <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>